home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 4065 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.0 KB  |  43 lines

  1. Path: news.mcs.net!not-for-mail
  2. From: mryba@MCS.COM (Michal L. Rybarski)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: C vs. C++ -> SAS/C binary size
  5. Date: 17 Feb 1996 14:37:30 -0600
  6. Organization: MCSNet Services
  7. Message-ID: <4g5eaa$km7@Venus.mcs.com>
  8. NNTP-Posting-Host: venus.mcs.com
  9. X-Newsreader: TIN [version 1.2 PL2 (KSD)]
  10.  
  11. OK this is a test code I've tried to compile:
  12.  
  13. #include <stdio.h>
  14. void main(void)
  15. {
  16.     printf("%s","Hello!");
  17. }
  18.  
  19. SLINK Complete - Maximum code size = 5788 ($0000169c) bytes
  20. Final output file size = 9308 ($0000245c) bytes 
  21.  
  22. versus:
  23.  
  24. #include <iostream.h>
  25. void main(void)
  26. {
  27.     cout << "Hello!";
  28. }
  29.  
  30. SLINK Complete - Maximum code size = 38412 ($0000960c) bytes
  31. Final output file size = 63736 ($0000f8f8) bytes  
  32.  
  33.  
  34. Why such a big difference in size of executables?  I understand that C++ 
  35. i/o is object oriented so, I imagine, it is more complex therefore it should 
  36. take longer to compile but why there should be any difference in the 
  37. size of the final binary?
  38.  
  39. Have I missed to set some vital settings?
  40.  
  41. please, help.
  42.     Michal 
  43.